package com.controleur.listener.impl;

import java.util.ArrayList;
import java.util.List;

import com.main.EasyLunch;
import com.modele.dao.impl.RestaurantDAO;
import com.modele.dao.impl.TypeRestaurantDAO;
import com.modele.entity.Restaurant;
import com.modele.entity.TypeRestaurant;

public class RestaurantControler {

	public RestaurantControler(){
		
		
	}
	
	public List<Restaurant> getAllRestaurant() {
		RestaurantDAO dao = (RestaurantDAO)EasyLunch.getFactory().getRestaurantDAO();
		
		return dao.findAll();

	}
	public Restaurant findByName(String name) {
		RestaurantDAO dao = (RestaurantDAO)EasyLunch.getFactory().getRestaurantDAO();
		return dao.findByName(name);

	}

	public ArrayList<TypeRestaurant> findAllType() {
		TypeRestaurantDAO dao = (TypeRestaurantDAO)EasyLunch.getFactory().getTypeRestaurantDAO();
		
		return dao.findAll();
	}


}
